#5 ✓resolved
Adam Williams

Text Folding

Reported by Adam Williams | May 20th, 2009 @ 12:27 PM

I have an event with this description String:

"Weather report looks nice, 80 degrees and partly cloudy, so following Michael's suggestion, let's meet at the food court at Crossroads:\n\nhttp://www.shopcrossroadsplaza.com/directory.html\n"

It comes out in the export as this:

DESCRIPTION:Weather report looks nice\, 80 degrees and partly cloudy\, so
  following Michael's suggestion\, let's meet at the food court at Crossr
 oads:
\n
\nhttp://www.shopcrossroadsplaza.com/directory.html
\n

or, if you prefer a String:

"DESCRIPTION:Weather report looks nice, 80 degrees and partly cloudy, so\n  following Michael's suggestion, let's meet at the food court at Crossr\n oads:\n\\n\n\\nhttp://www.shopcrossroadsplaza.com/directory.html\n\\n\n"

Comments and changes to this ticket

  • Rick DeNatale

    Rick DeNatale May 21st, 2009 @ 03:29 PM

    • Assigned user set to “Rick DeNatale”

    Adam,

    I'm having trouble reproducing this. I added the following to the event_spec

    context ".export" do

    # .. unrelated snippage
    
    before(:each) do
      cal = RiCal.Calendar
      @it = RiCal::Component::Event.new(cal)
    end
    
    # More unrelated snippage ...
    
    it "should properly fold on export" do
      @it.description = "Weather report looks nice, 80 degrees and partly cloudy, so following Michael's suggestion, let's meet at the food court at Crossroads:\n\nhttp://www.shopcrossroadsplaza.c...\n"
      export_string = @it.export
      rputs ("***********")
      rputs export_string
      rputs ("***********")
      export_string.should match(%r(^DESCRIPTION:Weather report looks nice\\, 80 degrees and partly cloudy\\, so$))
      export_string.should match(%r(^  following Michael's suggestion\\, let's meet at the food court at Crossr$))
      export_string.should match(%r(^ oads:\\n\\nhttp://www.shopcrossroadsplaza\.c\.\.\.\\n))
    end
    

    end

    This passes, and the rputs dump this:


    BEGIN:VCALENDAR
    PRODID;X-RICAL-TZSOURCE=TZINFO:-//com.denhaven2/NONSGML ri_cal gem//EN
    CALSCALE:GREGORIAN
    VERSION:2.0
    BEGIN:VEVENT
    DESCRIPTION:Weather report looks nice\, 80 degrees and partly cloudy\, so
    following Michael's suggestion\, let's meet at the food court at Crossr oads:\n\nhttp://www.shopcrossroadsplaza.c...\n END:VEVENT
    END:VCALENDAR


    Can you provide more info on this?

  • Rick DeNatale

    Rick DeNatale May 21st, 2009 @ 07:17 PM

    Here's the actual example:

        it "should properly fold on export" do
          @it.description = "Weather report looks nice, 80 degrees and partly cloudy, so following Michael's suggestion, let's meet at the food court at Crossroads:\n\nhttp://www.shopcrossroadsplaza.c...\n"
          export_string = @it.export
          export_string.should match(%r(^DESCRIPTION:Weather report looks nice\\, 80 degrees and partly cloudy\\, so$))
          export_string.should match(%r(^  following Michael's suggestion\\, let's meet at the food court at Crossr$))
          export_string.should match(%r(^ oads:\\n\\nhttp://www.shopcrossroadsplaza\.c\.\.\.\\n$))
        end
    

    If that doesn't format, then it's in event_spec.rb in the latest push to github, except for the $ in the last regexp, which I just notice was missing and added, but it still passes.

    Notice that I'm checking for an extra space after each line break. And I've attached a file which I wrote from the export which shows things look OK.

    So there must be something else going on with your specific use case.

  • Rick DeNatale

    Rick DeNatale May 22nd, 2009 @ 11:47 AM

    I'm not sure.

    The spec says that an intentional line break should be escaped by \n or \N, but I'm unclear what is meant here by an intentional line break.

    I guess I could convert any of
    \n \r\n \r \n\r

    into "\n" but I'm not sure that that's the right answer. I've asked calsify list for a recommendation, but they haven't been very responsive.

  • Rick DeNatale

    Rick DeNatale May 23rd, 2009 @ 04:39 PM

    • State changed from “new” to “open”

    I got one reply from the icalsify list, which indicated that I should treat any combination of /n /r as an "intentional" linebreak

  • Rick DeNatale

    Rick DeNatale May 23rd, 2009 @ 06:28 PM

    • State changed from “open” to “resolved”

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

A new icalendar data (RFC 2445) gem for Ruby which supports time zones and enumeration of occurrences

Shared Ticket Bins

People watching this ticket

Attachments

Pages